<meta charset="utf-8"/>
<script src="../lib/jquery-1.8.2.min.js"></script>
<script src="../lib/layer/layer.js"></script>

<button id="load1">默认</button>
<button id="load2">风格2</button>
<button id="load3">风格3</button>
 <button id="load4">风格4</button>
<script>
    (function(){
        $('#load1').on('click', function(){
            var ii = layer.load();
            //此处用setTimeout演示ajax的回调
            setTimeout(function(){
                layer.close(ii);
            }, 1000);
        });
        $('#load2').on('click',function(){
            var index = layer.load(1, {
                shade: [0.1,'#fff'] //0.1透明度的白色背景
            });
            setTimeout(function(){
                layer.close(index);
            }, 1000);
        });
        $('#load3').on('click',function(){
            var index = layer.load(2, {
                shade: [0.1,'#fff'] //0.1透明度的白色背景
            });
            setTimeout(function(){
                layer.close(index);
            }, 1000);
        });
        $('#load4').on('click',function(){
            var t = layer.msg('加载中', {icon: 16});
            setTimeout(function(){
                layer.close(t);
            }, 1000);
        });

    })();

</script>